#include "settingsdialog.h"

SettingsDialog::SettingsDialog(QWidget *parent) :
    QDialog(parent)
{
    setupUi(this);
}

void SettingsDialog::setFontSettings(QFont current_themeList_font,    bool themeListFont_isDefault,
                                     QFont current_articleText_font,  bool articleTextFont_isDefault)
{
    if( themeListFont_isDefault )
    {
        default_themeList_check->setChecked( true);

        themeList_ComboBox->setCurrentFont( QFont() );
    }
    else
    {
        themeList_fontSize_spinBox->setValue( current_themeList_font.pointSize() );
        themeList_ComboBox->setCurrentFont( current_themeList_font );
    }
    // ---------------------------------------------- //

    if( articleTextFont_isDefault )
    {
        articleComboBox->setCurrentFont( QFont() );                  // Получение дефолтных шрифтов

        default_article_checkbox->setChecked( true);
    }
    else
    {
        articleComboBox->setCurrentFont( current_articleText_font );
        articleText_fontSize_spinBox->setValue( current_articleText_font.pointSize() );
    }
}
